home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 May / PC Answers CD-ROM 7 (Future Publishing) (May 1995).iso / vbits / code / mee / vbdao / visdata / outlines.bas < prev    next >
Encoding:
BASIC Source File  |  1994-10-06  |  2.6 KB  |  70 lines

  1. Dim ctop As Integer
  2. Dim cleft As Integer
  3. Dim cright As Integer
  4. Dim cbottom As Integer
  5.  
  6. Const DarkGray = 8421504
  7. Const FullWhite = 16777215
  8.  
  9. Sub Outlines (formname As form)
  10.     On Error Resume Next
  11.  
  12.     Dim i As Integer
  13.     Dim cname As Control
  14.  
  15.     ' Outline a form's controls for 3D look if the control's TAG
  16.     ' property is set to "OLR" for raised and "OLS" for sunken.
  17.     For i = 0 To (formname.Controls.Count - 1)
  18.       Set cname = formname.Controls(i)
  19.       If (UCase(cname.Tag) = "OLS") Then
  20.         If cname.Visible = True Then
  21.           ctop = cname.Top - Screen.TwipsPerPixelY
  22.           cleft = cname.Left - Screen.TwipsPerPixelX
  23.           cright = cname.Left + cname.Width
  24.           cbottom = cname.Top + cname.Height
  25.           formname.Line (cleft, ctop)-(cright, ctop), DarkGray
  26.           formname.Line (cleft, ctop)-(cleft, cbottom), DarkGray
  27.           formname.Line (cleft, cbottom)-(cright, cbottom), FullWhite
  28.           formname.Line (cright, ctop)-(cright, cbottom), FullWhite
  29.         End If
  30.       ElseIf (UCase(cname.Tag) = "OLR") Then
  31.         If cname.Visible = True Then
  32.           ctop = cname.Top - Screen.TwipsPerPixelY
  33.           cleft = cname.Left - Screen.TwipsPerPixelX
  34.           cright = cname.Left + cname.Width
  35.           cbottom = cname.Top + cname.Height
  36.           formname.Line (cleft, ctop)-(cright, ctop), FullWhite
  37.           formname.Line (cleft, ctop)-(cleft, cbottom), FullWhite
  38.           formname.Line (cleft, cbottom)-(cright, cbottom), DarkGray
  39.           formname.Line (cright, ctop)-(cright, cbottom), DarkGray
  40.         End If
  41.       End If
  42.     Next i
  43. End Sub
  44.  
  45. Sub PicOutlines (pic As Control, ctl As Control)
  46.     On Error Resume Next
  47.     
  48.     ' Outline a container control for 3D look if the control's TAG
  49.     ' property is set to "OLR" for raised and "OLS" for sunken.
  50.     If ctl.Visible = False Then Exit Sub
  51.  
  52.     ctop = ctl.Top - Screen.TwipsPerPixelY
  53.     cleft = ctl.Left - Screen.TwipsPerPixelX
  54.     cright = ctl.Left + ctl.Width
  55.     cbottom = ctl.Top + ctl.Height
  56.     If ctl.Tag = "POLS" Then
  57.       pic.Line (cleft, ctop)-(cright, ctop), DarkGray
  58.       pic.Line (cleft, ctop)-(cleft, cbottom), DarkGray
  59.       pic.Line (cleft, cbottom)-(cright, cbottom), FullWhite
  60.       pic.Line (cright, ctop)-(cright, cbottom), FullWhite
  61.     ElseIf ctl.Tag = "POLR" Then
  62.       pic.Line (cleft, ctop)-(cright, ctop), FullWhite
  63.       pic.Line (cleft, ctop)-(cleft, cbottom), FullWhite
  64.       pic.Line (cleft, cbottom)-(cright, cbottom), DarkGray
  65.       pic.Line (cright, ctop)-(cright, cbottom), DarkGray
  66.     End If
  67.  
  68. End Sub
  69.  
  70.